package com.itjeffrey.autocode.bo;

import org.apache.commons.collections4.CollectionUtils;
import org.springframework.context.ApplicationEvent;

import java.util.HashSet;
import java.util.Set;

public class RandomWordBO extends ApplicationEvent{

    private Set<String> randomWords;

    public RandomWordBO(Object source, Set<String> randomWords) {
        super(source);
        this.randomWords = randomWords;
        if(CollectionUtils.isEmpty(randomWords)){
            this.randomWords = new HashSet<>();
        }
    }

    public Set<String> getRandomWords() {
        return randomWords;
    }

    @Override
    public String toString() {
        return "RandomWordBO{" +
                "randomWords=" + randomWords +
                '}';
    }
}
